﻿namespace MSSqlSchemaDoc.Core.DataStructures
{
    using System;
    using System.Xml.Serialization;

    /// <summary>
    /// Represents the settings of a computed column.
    /// </summary>
    [Serializable()]
    public class ComputedColumn
    {
        /// <summary>
        /// Gets or sets a value indicating whether the computation is persisted, or calculated on the fly.
        /// </summary>
        [XmlAttribute()]
        public bool IsPersisted { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the computed column uses the database's collation.
        /// </summary>
        [XmlAttribute()]
        public bool UsesDatabaseCollation { get; set; }

        /// <summary>
        /// Gets or sets the definition of the computation.
        /// </summary>
        [XmlAttribute()]
        public string Definition { get; set; }
    }
}
